package health.lm.com.home.presenter;

import com.blankj.utilcode.util.LogUtils;

import java.util.ArrayList;
import java.util.List;

import health.lm.com.component_base.base.mvp.contract.XPresent;
import health.lm.com.home.entity.HomePageEntity;
import health.lm.com.home.entity.HomePageListEntity;
import health.lm.com.home.fragment.HomePageFragment;
import health.lm.com.home.model.HomeModel;
import health.lm.com.network.callback.SimpleCallBack;

/**
 * Created by Android Studio .
 * Project：hlian health.lm.com.home.presenter
 * Date：2019/8/20 14:45
 * Introduce：首页资讯列表
 */
public class HomePagePresenter extends XPresent<HomePageFragment> {
    public void getData(String id, int page, int pageSize) {
        LogUtils.d("加载数据了————————————————————————");
        HomeModel.getInstance().getHomeNewsData(id, page, pageSize, new SimpleCallBack<HomePageListEntity>() {
            @Override
            public void onSuccess(HomePageListEntity pHomePageListEntity) {
                if (hasV()) getV().setNewData(pHomePageListEntity.getNews_list());
            }
        });
    }
}
